/*
 * Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __UVC_DEF_H
#define __UVC_DEF_H

#include <stdint.h>

#define v4l2_fourcc(a, b, c, d) \
    ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))

#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') // 16  YUV 4:2:2
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') // 16  YUV 4:2:0
#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') // 16  YUV 4:2:0
#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') // Motion-JPEG
#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') // JFIF JPEG
#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') // 1394
#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') // MPEG-1/2/4 Multiplexed
#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') // H264 with start codes
#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') // H264 without start codes
#define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') // H264 MVC
#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') // H263
#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') // MPEG-1 ES
#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') // MPEG-2 ES
#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') // MPEG-4 ES
#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') // Xvid
#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') // SMPTE 421M Annex G compliant stream
#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') // SMPTE 421M Annex L compliant stream
#define V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') // VP8

#endif // __UVC_DEF_H

